package com.servers.impl;

import java.util.HashMap;
import java.util.Map;

import org.apache.ibatis.jdbc.Null;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dao.AdminDao;
import com.entity.Admin;
import com.servers.AdminService;
@Service("adminService")
public class AdminServiceImpl implements AdminService {
	@Autowired
	private AdminDao adminDao;
	public AdminDao getAdminDao() {
		return adminDao;
	}
	public void setAdminDao(AdminDao adminDao) {
		this.adminDao = adminDao;
	}
	@Override
	public Map<String, Object> adminLogin(String name, String pwd) {
		Map<String, Object> map=new HashMap<>();
		Admin adminLogin = adminDao.AdminLogin(name, pwd);
		if (adminLogin!=null) {
			map.put("result", adminLogin);
			map.put("admin", adminLogin);
		}else {
			map.put("result", null);
		}
		return map;
	}

}
